def sum(num):
    print(num)
    if num==1:
        return
    #自己调用自己
    sum(num-1)

sum(5)


def sum_number(num):
    if num==1:
        return 1
    else:
        return num+sum_number(num-1)

res=sum_number(5)
print("最终的结果是",res)